<template>
  <el-select class="select-border-hidden" v-model="value" :clearable="clearable" :placeholder="placeholder" :size="size"
    @change="(value, option) => {
      emit('ojChange', value)
    }">
    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
  </el-select>
</template>

<script setup>
import { toRefs, ref } from 'vue'

const props = defineProps({
  placeholder: {
    type: String,
    default: '请选择'
  },
  size: {
    type: String,
    default: 'small'
  },
  options: {
    type: Array,
    required: true,
    default: () => []
  },
  clearable: {
    type: Boolean,
    default: false
  }
})

const { placeholder, size, options, clearable } = toRefs(props)

const emit = defineEmits(['ojChange'])
const value = ref('')

</script>

<style lang="less" scoped></style>